from binarytree import calctree

ls = calctree.parse_formula_to_list('1+2*((1+3)*2 + 5*(3+1))')
print(calctree.calctree_to_formula(calctree.flist_to_binarytree2(ls)))